﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TXTD.Admin.Data.Entitys.System
{
    [Table("SYS_SCHEDULED_TASK")]
    public class SysScheduledTask : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        [Column("SCHEDULED_TASK_ID")]
        [MaxLength(32)]
        public string ScheduledTaskId { get; set; } = Guid.NewGuid().ToString("N");

        /// <summary>
        /// 任务KeyName
        /// </summary>
        [Column("JOB_KEY_NAME")]
        [MaxLength(500)]
        public string JobKeyName { get; set; }

        /// <summary>
        /// 任务名称
        /// </summary>
        [Column("TASK_NAME")]
        [MaxLength(500)]
        public string TaskName { get; set; }

        /// <summary>
        /// 任务描述
        /// </summary>
        [Column("TASK_DESCRIBE")]
        [MaxLength(5000)]
        public string TaskDescribe { get; set; }

        /// <summary>
        /// 上次执行时间
        /// </summary>
        [Column("LAST_EXECUTION_TIME")]
        public DateTime? LastExecutionTime { get; set; }

        /// <summary>
        /// 下次执行时间
        /// </summary>
        [Column("NEXT_EXECUTION_TIME")]
        public DateTime? NextExecutionTime { get; set; }

        /// <summary>
        ///上次执行耗时 秒
        /// </summary>
        [Column("EXECUTION_TIME_CONSUMING")]
        public double ExecutionTimeConsuming { get; set; }

        /// <summary>
        /// CRON表达式
        /// </summary>
        [Column("CRON_EXPRESSION")]
        [MaxLength(100)]
        public string CronExpression { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        [Column("ENABLED")]
        public bool Enabled { get; set; }
    }
}
